#include "bar_provider.h"
#include <iostream>
#include <thread>

BarProvider::BarProvider()
    : Provider("test", "bar")
{
}

bool BarProvider::received(ProviderData *req, ProviderData *res)
{
    // 创建string
    std::string str(req->data, req->size);
    std::cout << "bar received: " << str << std::endl;

    res->data = "bar";
    res->size = 3;
    return true;
}
